package com.alibaba.service;


import com.alibaba.mapper.PkMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PkService {
    @Autowired
    PkMapper pkMapper;
    public void insertPk(int userId,float faceValue,int gender,int age,float smile,int emotion,float skinHealth,float skinStain ,float skinAcne,float skinDarkCircle,String imgUrl){
        pkMapper.insertPk(userId, faceValue, gender, age, smile, emotion, skinHealth, skinStain, skinAcne, skinDarkCircle, imgUrl);
    }

    public int selectUserId1(int hoursenum){
       return pkMapper.selectUserId1(hoursenum).getId1();
    }

    public int selectUserId2(int hoursenum){
        return pkMapper.selectUserId2(hoursenum).getId2();
    }

    public void updatePk1(int userId,int hoursenum){
        pkMapper.updatePk1(userId,hoursenum);
    }

    public void updatePk2(int userId,int hoursenum){
        pkMapper.updatePk2(userId,hoursenum);
    }

    public void insertPk3(int hoursenum){
        pkMapper.insertPk3(hoursenum);
    }

    public int selectHoursenum(int hoursenum){
        if(pkMapper.selectHoursenum(hoursenum)==null){
            return 0;
        }else
            return 1;
    }

    public void deletePk(int hoursenum){
        pkMapper.deletePk(hoursenum);
    }

}
